package com.htthorizon.neo4j.repository;

import com.htthorizon.neo4j.entity.RelationShip3;
import com.htthorizon.neo4j.entity.RelationShip4;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RelationShip4Repository extends Neo4jRepository<RelationShip4, Long> {
    @Query("MATCH (u:Upstream)<-[r:R4]-(f:Field) WHERE id(f) = $id RETURN u ,r,f")
    List<RelationShip4> getById(@Param("id")Long id);
    @Query("MATCH p=(a:Field)-[r:R4]->(b:Upstream) Where id(b)= $id  RETURN a,r,b")
    List<RelationShip4> findByBdId(@Param("id")Long id);
}
